var vm = new Vue({
    el: '#app',
    data: {
        menu_html: '',
        info_html: '',// 个人信息
        articleList: '', // 文章列表
        articleUrl: baseURL + "/article/get/",
        projectUrl:projectURL,
        random: ''
    },
    methods: {
        getMenu: function () {
            $("#menu").load("menu.html", function (response) {
                vm.menu_html = response;
            });

        },
        // 右侧个人信息
        getLeftContent: function () {
            $("#info").load("info.html", function (response) {
                vm.info_html = response;
            });
        },
        getArticleList: function () {
            var url = this.articleUrl + "list/1/5";
            $.get(url, function (data) {
                // 格式化日期
                var articleList = data.articleList;
                for (var i = 0; i < articleList.length; i++) {
                    articleList[i].gmtModify = new Date(articleList[i].gmtModify).format("yyyy-MM-dd hh:mm:ss");
                }
                vm.articleList = articleList;
                var oNow = new Date();
                vm.random = oNow.getSeconds();
            });
        }
    }
    ,
    created: function () {
        this.getMenu();
        this.getLeftContent();
        this.getArticleList();
    }

});

